\3. Longest Substring Without Repeating Characters
Medium
Given a string, find the length of the longest substring without repeating characters.
Example 1:
1 | Input: "abcabcbb" |
Example 2:
1 | Input: "bbbbb" |
Example 3:
1 | Input: "pwwkew" |
改良法
使用res 变量来记录最终答案 而不是一个list,节省空间
1 | class Solution: |
- 使用字典
1 | class Solution: |